package cn.edu.zafu.bigdata.liuwenyi;

class Vehicle{
    public void move(){
        System.out.println("Vehicle is moving");
    }
}

class Car extends Vehicle{
    public void move(){
        System.out.println("Car is moving");
    }
}

class Bicycle extends Vehicle{
    public  void move(){
        System.out.println("Bicycle is moving");
    }
}


public class Vehicle_Test {
    public static void main(String[] args) {
        Vehicle car = new Car();
        Vehicle bicycle = new Bicycle();

        Vehicle[] vehicles = { car, bicycle };

        for(Vehicle vehicle: vehicles){
            vehicle.move();
        }
    }
}
